# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=node-ar-drone
pkgver=281.11667d4
pkgrel=2
pkgdesc='A node.js client for controlling Parrot AR Drone 2.0 quad-copters.'
arch=('any')
url='https://github.com/felixge/node-ar-drone'
license=('MIT')
depends=('nodejs')
makedepends=('git' 'npm')
source=("git+https://github.com/felixge/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  npm install
}

package() {
  cd $pkgname

 install -dm 755 "$pkgdir/usr/lib/node_modules/$pkgname"

 cp --no-preserve=ownership -r \
   {lib,examples,node_modules,test,index.js,Makefile,package.json} \
     "$pkgdir/usr/lib/node_modules/$pkgname/"

 install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md Changes.md \
   CONTRIBUTING.md
 install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

